
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta name="description" content="">
<title>砸金蛋</title>
<link href="<?php echo MODULE_URL;?>/template/mobile/css/activity-egg.css?v=1" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<?php echo MODULE_URL;?>/template/mobile/js/jquery-1.js"></script>
</head>
<body class="activity-lottery-winning" >
<div class="egg">
    <ul class="eggList">    
        <p class="hammer" id="hammer">锤子</p> 
        <!-- <p class="resultTip" id="resultTip"><b id="result">砸金蛋 赢积分</b></p>    -->
        <p style="text-align:center;"><img src="<?php echo MODULE_URL;?>/template/mobile/images/topper.png" width="80%"/></p>     
        <li><span>1</span><sup></sup></li> 
        <li><span>2</span><sup></sup></li> 
        <li><span>3</span><sup></sup></li>   
    </ul> 
</div>

<div class="button">
    <img src="<?php echo MODULE_URL;?>/template/mobile/images/back.png" class='back'>
</div>

<div class="boxcontent boxyellow" id="addname_no" style="display:none">
    <div class="box">
        <div class="title-orange"><span>中奖结果：</span></div>
        <div class="Detail">
          <p>很遗憾，你没有中奖！</p>
          <input type="button" value="继续砸金蛋" class="pxbtn" onclick="javascript:window.location.reload();">
        </div>
    </div>
</div>
<div class="boxcontent boxyellow">
    <div class="box">
        <div class="title-orange"><span>活动奖品：</span></div>
        <div>
            <?php echo html_entity_decode($sets['prize']);?> 
        </div>
    </div>
</div>
<div class="boxcontent boxyellow">
    <div class="box">
        <div class="title-orange"><span>活动规则：</span></div>
        <div>
            <?php echo html_entity_decode($sets['rule']);?>
        </div>
    </div>
</div>

<div class="boxcontent boxyellow">
    <div class="box">
        <div class="title-orange"><span>我的中奖记录：</span></div>
        <table style="width:100%;text-align:center">
            <tr>
                <td width="20%">编号</td>
                <td width="50%">中奖时间</td>
                <td>奖品</td>
            </tr>
                    </table>
    </div>
</div>

<script type="text/javascript">
$(".eggList li").hover(function(){ 
    var posL = $(this).position().left + $(this).width(); 
    $("#hammer").show().css('left', posL); 
})

$(".eggList li").bind('click',function(){  
    eggClick($(this));
});

function eggClick(obj){
    var _this = obj;
    $(".eggList li").unbind('click'); //解除click
    $.ajax({
        type:"post",
        url:"{php echo $this->createMobileUrl('chou');}",  
        data:{token:"K*vaup*V3xDiZsCtTV/V7Go3gupe4fe1H6Y0fcZanmYm0sTUE1B8D2w2CA"},
        success:function(data){
            if(data == 'Illegal'){
                $(".eggList li").bind('click',function(){  
                    eggClick($(this));
                });
                alert('您的请求不合法，你退出重新注册');
                return false;       
            }else if(data == 'Unenough'){
                $(".eggList li").bind('click',function(){  
                    eggClick($(this));
                });
                alert('您的积分不足');
                return false;       
            }else{
                var data = eval('('+data+')');
                if(data.success){
                    $(".hammer").css({"top":_this.position().top-25,"left":_this.position().left+120});
                    _this.children("span").hide();
                    $(".hammer").animate({//锤子动画
                        "top":_this.position().top-5, 
                        "left":_this.position().left+100 
                        },500,function(){
                            _this.addClass("curr"); //蛋碎效果 
                            _this.find("sup").show(); //金花四溅 
                            $(".hammer").hide();//隐藏锤子
                            if(data.prize == 6){
                                $("#result").html('很遗憾,您没能中奖!');
                                $(".Detail p").html('很遗憾,您没能中奖!');
                                $("#addname_no").slideToggle(1000);
                            }else{
                                $("#result").html(data.name);
                                $(".Detail p").html('恭喜您中了'+data.name);
                                $("#addname_no").slideToggle(1000);
                            }
                            
                        } 
                    );
                }                   
            }
        },
        error:function(){},
    })
}

$(".list").bind("click",function(){
    alert('暂未开放');
    // var submitData={token:"K*vaup*V3xDiZsCtTV/V7Go3gupe4fe1H6Y0fcZanmYm0sTUE1B8D2w2CA"};
    // $.post( "http://ali.qswhcb.com/wxtx/sign/get_list",
    //     submitData,
    //     function(data){
    //         if(data==true){
    //             alertify.alert("提交成功，谢谢您的参与",reload_window);
    //         }else{
    //             alertify.alert('提交失败，请联系管理员',reload_window);
    //         }
    //     },"json")
});

$(".back").bind("click",function(){
    history.go(-1);
});

</script>
</body>
</html>
